Builds a Menu, given a MenuBar and a list of items.
VxMenu formDialog menuBar menuList defaultCB
To create a MenuBar on a Form dialog, you must specify the Form dialog to place the MenuBar on, the widget name of the MenuBar, a list of Menu item widgets to place on the MenuBar, and a default callback (if no callbacks are specified for the Menu items). Menu item widgets are buttons; typically, when a button in a MenuBar is pressed its callback creates a Menu.
Each item in menuList is a list in the format:
type name mnemonic accelerator accelerator_string callback state
where:
The following code produces a MenuBar containing two Menus.
set menuList { {pd Fruits F} {bt Kumquat K "" "" } {bt Apple A "" "" } {bt Grape G "" "" } {bt Banana B "" "" } {sp} {bt Mango M "" "" } {pd Vegetables V} {bt Leek L "" "" "" } {bt Onion O "" "" "" } } set menubar [VtMenuBar $form.menubar] VxMenu $form $menubar $menuList defaultCB
This code produces the following:
Use VxMenuGetButton to get the reference to a Menu item widget; for example:
VxMenuGetButton $dlog "New"
See also VxMenuGetButton.